/**
 * 
 */
package com.blazegame.logging.async;


import com.blazegame.logging.LogLevel;
import com.blazegame.logging.Logger;

/**
 * @author JackChu
 * @version 2011-7-8 下午02:38:05
 */
public class LogTask {
	private Logger logger = null;
	private String message = null;
	private Throwable exception = null;
	private LogLevel level = null;

	public LogTask(Logger logger, String message, Throwable t, LogLevel level) {
		this.message = message;
		this.exception = t;
		this.logger = logger;
		this.level = level;
	}

	public void log() {
		switch (level) {
		case DEBUG:
			logger.debug(message, exception);
			break;
		case INFO:
			logger.info(message, exception);
			break;
		case WARN:
			logger.warn(message, exception);
			break;
		case ERROR:
			logger.error(message, exception);
			break;
		case FATAL:
			logger.fatal(message, exception);
			break;
		default:
			break;
		}
	}
}
